$("#loginForm").submit(function (){
	
	var username = $("#username");	//用户名
	var password = $("#password");	//密码
	
	if(username.val() == ""){
		$.message("warn", "请输入您的用户名");
		return false;
	}
	
	if(password.val() == ""){
		$.message("warn", "请输入您的密码");
		return false;
	}
	
	var data = {
		"userName" : username.val(),
		"userPassword" : password.val()
	};	//传递后台数据
	
	$.post(wp.config.baseUrl + "/rest/admin/login", data, function (result) {
		if(result.type && result.type != "success"){
			$.message(result.msg);
		} else {
			baseWindow(window).location.href = wp.config.baseUrl + "/rest/admin/mvc/index";
		}
	},"json");
	return false;
});